<?php
require_once("./config/dbconfig.php");
define("XH_PARAM_INT",0);
define("XH_PARAM_TXT",1);
function SafeString($pi_strName, $pi_Def = "", $pi_iType = XH_PARAM_TXT)
{
	//$_GET['f_uid']
	//$t_strUid = SafeString("f_uid",  0, XH_PARAM_INT);
  	//$t_strPwd = SafeString("f_pwd", "", XH_PARAM_TXT);
  if ( isset($_GET[$pi_strName]) )
    $t_Val = trim($_GET[$pi_strName]);
  else if ( isset($_POST[$pi_strName]))
    $t_Val = trim($_POST[$pi_strName]);
  else
    return $pi_Def;
 
  // INT
  if ( XH_PARAM_INT == $pi_iType)
  {
    if (is_numeric($t_Val))
      return $t_Val;
    else
      return $pi_Def;
  }
  
  // String
  $t_Val = str_replace("&", "&amp;",$t_Val);
  $t_Val = str_replace("<", "&lt;",$t_Val);
  $t_Val = str_replace(">", "&gt;",$t_Val);
  if ( get_magic_quotes_gpc() )
  {
    $t_Val = str_replace("\\\"", "&quot;",$t_Val);
    $t_Val = str_replace("\\''", "&#039;",$t_Val);
  }
  else
  {
    $t_Val = str_replace("\"", "&quot;",$t_Val);
    $t_Val = str_replace("'", "&#039;",$t_Val);
  }
  return $t_Val;
}
$path="/gjj/backend/web/";
$ip=$GLOBALS['db']['server'];
$url_test="www.jajahome.com";
$url_run="app.jajahome.com";
$domain="www.jajahome.com";
$local="http://".$domain."/furniture/";
$conn = mysqli_connect($GLOBALS['db']['server'], $GLOBALS['db']['username'],$GLOBALS['db']['password'],$GLOBALS['db']['database']);
mysqli_set_charset($conn,"utf8");
?>